<template>
  <el-table ref="singleTable" :data="rightsList" highlight-current-row style="width: 100%">
    <el-table-column type="index" :index="getIndex" width="50"></el-table-column>
    <el-table-column property="authName" label="权限名称" width="120"></el-table-column>
    <el-table-column property="path" label="路径" width="120"></el-table-column>
    <el-table-column label="等级">
      <template slot-scope="scope">
        <div>{{scope.row.level == 0 ? '一级' : scope.row.level == 1 ? '二级':'三级'}}</div>
      </template>
    </el-table-column>
  </el-table>
</template>

<script>
export default {
  data: function () {
    return {
      rightsList: []
    }
  },
  async created () {
    const res = await this.axios.get('rights/list')
    this.rightsList = res.data.data
    console.log(this.rightsList)
  },
  methods: {
    getIndex (index) {
      return index
    }
  }
}
</script>

<style>
</style>
